package com.nuoniu.sibanyun.controller.production;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nuoniu.sibanyun.common.result.HttpResult;
import com.nuoniu.sibanyun.entity.dto.BatchExamineDto;
import com.nuoniu.sibanyun.entity.dto.ErpWorkProcedureCardDetailDto;
import com.nuoniu.sibanyun.entity.dto.WorkProcedureReportDto;
import com.nuoniu.sibanyun.entity.production.ErpWorkProcedureCardDetail;
import com.nuoniu.sibanyun.entity.vo.ErpWorkProcedureCardDetailVo;
import com.nuoniu.sibanyun.entity.vo.ProcedureCardDetailVo;
import com.nuoniu.sibanyun.entity.vo.WorkProcedureReportResult;
import com.nuoniu.sibanyun.service.production.IErpWorkProcedureCardDetailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.nuoniu.sibanyun.common.BaseController;

import java.util.List;

/**
 * <p>
 * 工序汇报 前端控制器
 * </p>
 *
 * @author 白强
 * @since 2021-03-30
 */
@RestController
@RequestMapping("/erp/workProcedureCardDetail")
@Api(tags = "工序汇报")
public class ErpWorkProcedureCardDetailController extends BaseController {

    @Autowired
    private IErpWorkProcedureCardDetailService erpWorkProcedureCardDetailService;

//    @ApiOperation("新建 工序汇报记录")
//    @PostMapping("createCardDetail")
//    public HttpResult save(@RequestBody ErpWorkProcedureCardDetail erpWorkProcedureCardDetail) {
//        erpWorkProcedureCardDetailService.createCardDetail(erpWorkProcedureCardDetail,null);
//        return HttpResult.ok();
//    }
//
//    @ApiOperation("批量汇报 工序汇报记录")
//    @PostMapping("batchSaveCardDetail")
//    public HttpResult batchSaveCardDetail(@RequestBody List<ErpWorkProcedureCardDetail> erpWorkProcedureCardDetailList) {
//        erpWorkProcedureCardDetailService.batchSaveCardDetail(erpWorkProcedureCardDetailList);
//        return HttpResult.ok();
//    }
//
//    @ApiOperation("批量汇报 工序汇报记录")
//    @PostMapping("batchReportBarcode")
//    public HttpResult<WorkProcedureReportResult> batchSaveCardDetail(@RequestBody WorkProcedureReportDto workProcedureReportDto) {
//        return HttpResult.ok(erpWorkProcedureCardDetailService.batchSaveCardDetail(workProcedureReportDto));
//    }
//
//
//
//    @ApiOperation("通过IDs批量获取 工序汇报记录")
//    @PostMapping("listByIds")
//    public HttpResult<List<ProcedureCardDetailVo>> listByIds(@RequestBody List<Long> ids) {
//        return HttpResult.ok(erpWorkProcedureCardDetailService.listByIds(ids));
//    }


//    @ApiOperation("批量审核 工序汇报记录")
//    @PostMapping("batchExamine")
//    public HttpResult batchExamine(@RequestBody BatchExamineDto batchExamineDto) {
//        erpWorkProcedureCardDetailService.batchExamine(batchExamineDto.getIds(), batchExamineDto.getStatus());
//        return HttpResult.ok();
//    }
//
//
//    @ApiOperation("批量删除 工序汇报记录")
//    @PostMapping("batchDelete")
//    public HttpResult batchDelete(@RequestBody List<Long> ids) {
//        erpWorkProcedureCardDetailService.batchDelete(ids);
//        return HttpResult.ok();
//    }

//    @GetMapping("/getReportCode")
//    @ApiOperation(value = "获取汇报编号",tags = "APP_生产制造")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "workProcedureDetailId", value = "加工单明细ID"),
//            @ApiImplicitParam(name = "productionWorkCode", value = "加工单号")
//    })
//    public HttpResult<ProcedureCardDetailVo> getReportCode(Integer workProcedureDetailId,String productionWorkCode) {
//        return HttpResult.ok(erpWorkProcedureCardDetailService.getReportCode(workProcedureDetailId, productionWorkCode));
//    }

//    @GetMapping("/listProcedureCardDetailVoMobile")
//    @ApiOperation(value = "通过 派工工序任务明细ID 查询工序汇报记录",tags = "APP_生产制造")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "workProcedureDetailId", value = "工序任务ID")
//    })
//    public HttpResult<ProcedureCardDetailVo> listProcedureCardDetailVoMobile(Integer workProcedureDetailId) {
//        return HttpResult.ok(erpWorkProcedureCardDetailService.listProcedureCardDetailVoMobile(workProcedureDetailId));
//    }
//
//
//    @ApiOperation("分页查询 已经提交的 工序汇报")
//    @PostMapping("page")
//    public HttpResult<Page<ErpWorkProcedureCardDetailVo>> pageErpWorkProcedureCardDetailVo(@RequestBody ErpWorkProcedureCardDetailDto erpWorkProcedureCardDetailDto) {
//
//        return HttpResult.ok(erpWorkProcedureCardDetailService.pageErpWorkProcedureCardDetailVo(erpWorkProcedureCardDetailDto.getPage(), erpWorkProcedureCardDetailDto));
//    }



}
